package com.example.mansystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mansystem.entity.ApiDO;
import com.example.mansystem.entity.RoleDO;
import com.example.mansystem.entity.RouterDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RoleMapper extends BaseMapper<RoleDO> {
    List<String> getRouteByRoleId(@Param("roleId") Integer roleId);

    List<String> getApiByRoleId(@Param("roleId") Integer roleId);

    List<RouterDO> getAllRoute();

    List<ApiDO> getAllApi();


    boolean addRole(@Param("roleName") String roleName);

    boolean  insertRoutePoession(@Param("roleId") Integer roleId,@Param("routeId") Integer routeId);

    boolean  deleteRoutePoession(@Param("roleId") Integer roleId,@Param("routeId") Integer routeId);

    boolean  insertApiPoession(@Param("roleId") Integer roleId,@Param("apiId") Integer apiId);

    boolean  deleteApiPoession(@Param("roleId") Integer roleId,@Param("apiId") Integer apiId);

    boolean deleteRole(@Param("roleId") Integer roleId);
}
